package com.baidu.fd1931springbootdemo.service.impl;

import com.baidu.fd1931springbootdemo.bean.ListOfPlayers;
import com.baidu.fd1931springbootdemo.dao.ListOfPlayersDao;
import com.baidu.fd1931springbootdemo.service.ListOfPlayersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ListOfPlayersServiceImpl implements ListOfPlayersService {

    @Autowired
    private ListOfPlayersDao listOfPlayersDao;

    @Override
    public List<ListOfPlayers> listOfPlayersService() {
        return listOfPlayersDao.findAll();
    }

    @Override
    public void upDataService(ListOfPlayers listOfPlayers) {
        listOfPlayersDao.upDate(listOfPlayers);
    }

    @Override
    public void incReaseService(ListOfPlayers listOfPlayers) {
        listOfPlayersDao.incRease(listOfPlayers);
    }

    @Override
    public void deleteService(int id) {
        System.out.println("id = " + id);
        listOfPlayersDao.delete(id);
    }
}
